/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.garagesale.user.web.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import static com.garagesale.web.util.FormUtils.*;

/**
 *
 * @author christophe
 */
public class CheckOutForm extends org.apache.struts.action.ActionForm {
    
  
    private String creditCardNumber;
    private String expirationDate;
    private String securityCode;
    private String cardType;
    private String street;
    private String city;
    private String state;
    private String zip;

    private String sStreet;
    private String sCity;
    private String sState;
    private String sZip;
    private String phoneNumber;

    private Double total;

    public Double getTotal()
    {
        return total;
    }

    public void setTotal(Double total)
    {
        this.total = total;
    }

    

    public String getCardType()
    {
        return cardType;
    }

    public void setCardType(String cardType)
    {
        this.cardType = cardType;
    }

    public String getCity()
    {
        return city;
    }

    public void setCity(String city)
    {
        this.city = city;
    }

    public String getCreditCardNumber()
    {
        return creditCardNumber;
    }

    public void setCreditCardNumber(String creditCardNumber)
    {
        this.creditCardNumber = creditCardNumber;
    }

    public String getExpirationDate()
    {
        return expirationDate;
    }

    public void setExpirationDate(String expirationDate)
    {
        this.expirationDate = expirationDate;
    }

    public String getPhoneNumber()
    {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber)
    {
        this.phoneNumber = phoneNumber;
    }

    public String getsCity()
    {
        return sCity;
    }

    public void setsCity(String sCity)
    {
        this.sCity = sCity;
    }

    public String getsState()
    {
        return sState;
    }

    public void setsState(String sState)
    {
        this.sState = sState;
    }

    public String getsStreet()
    {
        return sStreet;
    }

    public void setsStreet(String sStreet)
    {
        this.sStreet = sStreet;
    }

    public String getsZip()
    {
        return sZip;
    }

    public void setsZip(String sZip)
    {
        this.sZip = sZip;
    }

    public String getSecurityCode()
    {
        return securityCode;
    }

    public void setSecurityCode(String securityCode)
    {
        this.securityCode = securityCode;
    }

    public String getState()
    {
        return state;
    }

    public void setState(String state)
    {
        this.state = state;
    }

    public String getStreet()
    {
        return street;
    }

    public void setStreet(String street)
    {
        this.street = street;
    }

    public String getZip()
    {
        return zip;
    }

    public void setZip(String zip)
    {
        this.zip = zip;
    }



    

    /**
     *
     */
    public CheckOutForm() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();


        // TODO: Validate

        ensureExistence(cardType, "Cart Type", errors);
        ensureExistence(creditCardNumber, "Credit Card Number", errors);
        ensureExistence(securityCode, "Security Code", errors);
        ensureExistence(expirationDate, "Expiration Date", errors);
        ensureExistence(sCity, "Shopping City", errors);
        ensureExistence(sState, "Shipping State", errors);
        ensureExistence(sStreet, "Shipping Street Address", errors);
        ensureExistence(sZip, "Billing Zip", errors);
        ensureExistence(city, "Billing City", errors);
        ensureExistence(state, "Billing State", errors);
        ensureExistence(street, "Billing Street Address", errors);
        ensureExistence(zip, "Billing Zip", errors);




        return errors;
    }
}
